<?php ob_start();
    $bedroom = Model_Listing_Residential::getBedroom();
    $listing = $this->listing;
	$internal_lng = $listing->getInternalLanguage();
	$cat_search = $this->listing->category[0]->getParent();
?>
    <?php if (!empty($listing->bedroom)) {
	    $bedrooms = ($bedroom[$listing->bedroom] > 1) ? '<a href="/search/regular?small_category_list=' . $cat_search->path[0] . '&bedroom=' . $listing->bedroom . '">' . Ac_Util::getChineseNumber($bedroom[$listing->bedroom]) . '个卧室' . '</a>' : '<a href="/search/regular?keyword=&small_category_list=residential&bedroom=' . $listing->bedroom . '">' . Ac_Util::getChineseNumber($bedroom[$listing->bedroom]) . '个卧室' . '</a>';
	    
		$livingrooms = !empty($listing->other_room) ? ', <a href="/search/regular?small_category_list=' . $cat_search->path[0] . '&livingroom=' . $listing->other_room . '">'. Ac_Util::getChineseNumber($listing->other_room) . '厅</a>' : '';
	    
	    $bathrooms = !empty($listing->bathroom) ? ', <a href="/search/regular?small_category_list=' . $cat_search->path[0] . '&bathroom=' . $listing->bathroom .'&bathroom-1=' . $listing->bathroom . '">'. Ac_Util::getChineseNumber($listing->bathroom) . '卫生间</a>' : '';
	    
    	echo $this->dtDd($this->t('House Type', $internal_lng), $bedrooms.$livingrooms.$bathrooms);
    }?>
    <?php if (!empty($listing->which_floor)) {
        echo $this->dtDd($this->t('Which Floor', $internal_lng), $this->t('__1__Floor', $internal_lng, number_format((int)$listing->which_floor)));
    }?>
    <?php if (!empty($listing->total_floor)) {
        echo $this->dtDd($this->t('Total Floors', $internal_lng), $this->t('__1__Layer', $internal_lng, number_format((int)$listing->total_floor)));
    }?>   
    <?php if (!empty($listing->total_size)) {
        echo $this->dtDd($this->t('Total Size', $internal_lng), $this->t('__1__平方米', $internal_lng, number_format((int)$listing->total_size)));
    }?>
    <?php if (!empty($listing->size)) {
        echo $this->dtDd($this->t('Size', $internal_lng), $this->t('__1__平方米', $internal_lng, number_format((int)$listing->size)));
    }?>
    <?php if (!empty($listing->renovation)) {
    	$views = Model_Listing_Residential::getRenovationPostAd();
        echo $this->dtDd($this->t('Renovation', $internal_lng), $views[$listing->renovation]);
    }?>
    <?php if (!empty($listing->complex)) {
        echo $this->dtDd($this->t('Complex', $internal_lng), $listing->complex);
    }?>
    <?php if (!empty($listing->rent_type)) {
    	$views = Model_Listing_Residential::getRentTypePostAd();
        echo $this->dtDd($this->t('Rent Type', $internal_lng), $views[$listing->rent_type]);
    }?>
    
    <?php /*if (!empty($listing->toilet)) {
        echo $this->dtDd($this->t('Toilet', $internal_lng), Ac_Util::getChineseNumber($listing->toilet));
    }*/?>
    <?php /*if (!empty($listing->bathroom)) { 
        echo $this->dtDd($this->t('Bathrooms', $internal_lng), Ac_Util::getChineseNumber($listing->bathroom));
    }*/?>    
    <?php /*if (!empty($listing->other_room)) {
        echo $this->dtDd($this->t('Other Room', $internal_lng), Ac_Util::getChineseNumber($listing->other_room));
    }*/?>
     
    <?php
    if (!empty($listing->building_type)) {
        $views = Model_Listing_Residential::getBuildingType();
        echo $this->dtDd($this->t('Building Type', $internal_lng), $this->t($views[$listing->building_type], $internal_lng));
    }
    ?>
    <?php if (!empty($listing->building_age)) { 
        echo $this->dtDd($this->t('Building Age', $internal_lng), $this->t('__1__ years', $internal_lng, $listing->building_age));
    }?>    
    <?php //if (!empty($listing->floor_zone)) { echo $this->dtDd($this->t('Ground Zone', $internal_lng), $listing->floor_zone);}?>
    <?php
    if (!empty($listing->floor_zone)) {
        $views = Model_Listing_Residential::getFloorZone();
        echo $this->dtDd($this->t('Ground Zone', $internal_lng), $this->t($views[$listing->floor_zone], $internal_lng));
    }
    ?>
    <?php
    if (!empty($listing->facilities)) {
        $i          = 0;
        $field      = '';
        $facilities = Model_Listing_Residential::getFacilities();
        $to_add     = '';
        foreach ((array)$listing->facilities as $data) {
            $field .= $to_add . $this->t($facilities[$data], $internal_lng);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Facilities', $internal_lng), $field);
    }
    ?>
    <?php
    if (!empty($listing->views)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Residential::getViews();
        $to_add     = '';
        foreach ((array)$listing->views as $data) {
            $field .= $to_add . $this->t($views[$data], $internal_lng);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Views', $internal_lng), $field);
    }
    ?>
    <?php
    if (!empty($listing->direction)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Residential::getDirections();
        $to_add     = '';
        foreach ((array)$listing->direction as $data) {
            $field .= $to_add . $this->t($views[$data], $internal_lng);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Direction', $internal_lng), $field);
    }
    ?>    
    <?php
    if (!empty($listing->rooms)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Residential::getRooms();
        $to_add     = '';
        foreach ((array)$listing->rooms as $data) {
            $field .= $to_add . $this->t($views[$data], $internal_lng);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Rooms', $internal_lng), $field);
    }
    ?>
    <?php
    if (!empty($listing->outdoor)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Residential::getOutdoor();
        $to_add     = '';
        foreach ((array)$listing->outdoor as $data) {
            $field .= $to_add . $this->t($views[$data], $internal_lng);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Outdoor', $internal_lng), $field);
    }
    ?>
    <?php
    if (!empty($listing->layout)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Residential::getLayout();
        $to_add     = '';
        foreach ((array)$listing->layout as $data) {
            $field .= $to_add . $this->t($views[$data], $internal_lng);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Layout', $internal_lng), $field);
    }
    ?>
    <?php
    if (!empty($listing->conditions)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Residential::getConditions();
        $to_add     = '';
        foreach ((array)$listing->conditions as $data) {
            $field .= $to_add . $this->t($views[$data], $internal_lng);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Conditions', $internal_lng), $field);
    }
    ?>
    <?php if (!empty($listing->other)) { echo $this->dtDd($this->t('Other', $internal_lng), $listing->other); } ?>
    <?php 
        if (!empty($listing->management_fee)) { 
            if ($listing->management_fee == 'inc') {
                $val = $this->t('Included', $internal_lng);
            } else {
               $val = $this->t('HKD __1__', $internal_lng, number_format($listing->management_fee));
            }
            echo $this->dtDd($this->t('Management Fee', $internal_lng), $val);
        }
    ?>
    <?php 
        if (!empty($listing->government_fee)) { 
            if ($listing->government_fee == 'inc') {
                $val = $this->t('Included', $internal_lng);
            } else {
               $val = $this->t('HKD __1__', $internal_lng, number_format($listing->government_fee));
            }
            echo $this->dtDd($this->t('Government Rate', $internal_lng), $val);
        }
    ?>

<?php $content = trim(ob_get_clean())?>
<?php if (!empty($content)):?>
    <section class="category">
        <h3><?php echo $this->t('Property Information');?></h3>
        <dl>
            <?php echo $content ?>
        </dl>
    </section>
<?php endif;?>
